package com.example.demo.exception;

import com.example.demo.enums.APIErrorCommonEnum;

public class AuthException extends RuntimeException {
    private int code = APIErrorCommonEnum.UN_AUTH.getCode();

    public AuthException(APIErrorCommonEnum apiErrorCommonEnum) {
        super(apiErrorCommonEnum.getMessage());
    }

    public AuthException() {
        super();
    }

    public AuthException(APIErrorCommonEnum apiErrorCommonEnum, Throwable cause) {
        super(apiErrorCommonEnum.getMessage(), cause);
    }

    public AuthException(Throwable cause) {
        super(cause);
    }

    public AuthException(int code, APIErrorCommonEnum apiErrorCommonEnum) {
        super(apiErrorCommonEnum.getMessage());
        this.code = code;
    }

    private int getCode() {
        return code;
    }
}
